﻿@{
    var db = new SnongPhoneShop.Models.SnongPhoneShopEntities();
}
<!DOCTYPE html>

<html>
<head>
    <meta name="viewport" content="width=device-width" />
    <title>@ViewBag.Title</title>
    <link href="~/Contents/Shamcey/style.default.css" rel="stylesheet" />
    <link href="~/Contents/Shamcey/responsive-tables.css" rel="stylesheet" />
    <link href="~/Contents/CustomShamcey.css" rel="stylesheet" />
    <script src="~/Scripts/jsadmin/jquery-1.9.1.min.js"></script>
    <script src="~/Scripts/jsadmin/jquery-migrate-1.1.1.min.js"></script>
    <script src="~/Scripts/jsadmin/jquery-ui-1.9.2.min.js"></script>
    <script src="~/Scripts/jsadmin/jquery.dataTables.min.js"></script>
    <script src="~/Scripts/jsadmin/bootstrap.min.js"></script>
    <script src="~/Scripts/jsadmin/modernizr.min.js"></script>
    <script src="~/Scripts/jsadmin/jquery.uniform.min.js"></script>
    <script src="~/Scripts/jsadmin/jquery.cookie.js"></script>
    <script src="~/Scripts/jsadmin/flot/jquery.flot.min.js"></script>
    <script src="~/Scripts/jsadmin/flot/jquery.flot.resize.min.js"></script>
    <script src="~/Scripts/jsadmin/responsive-tables.js"></script>
    <script src="~/Scripts/jsadmin/custom.js"></script>
    <script type="text/javascript">
        jQuery(document).ready(function () {
            
        })
    </script>
    <!--[if lte IE 8]><script language="javascript" type="text/javascript" src="js/excanvas.min.js"></script><![endif]-->
</head>
<body>
    <div class="mainwrapper">

        <div class="header">
            <div class="logo">
                <a href="@Url.Action("Index", "Admin")"><img src="/Images/logo.png" alt="" /></a>
            </div>
            <div class="headerinner">
                <ul class="headmenu">
                    <li class="odd">
                        @{
                            var Notif = db.PhieuDatHangs.Where(m => m.Unread).OrderByDescending(m => m.MaPhieuDatHang).ToList();
                        }
                        <a class="dropdown-toggle" data-toggle="dropdown" href="#">
                            <span class="count">@Notif.Count</span>
                            <span class="head-icon head-message"></span>
                            <span class="headmenu-label">Thông báo</span>
                        </a>
                        <ul class="dropdown-menu">
                            <li class="nav-header">Messages</li>
                            @foreach (var Item in Notif)
                            {
                                var timespan = DateTime.Now - (DateTime)Item.NgayLapPhieu;
                                string t = "";
                                if (timespan.Days > 0)
                                {
                                    t = timespan.Days + " ngày trước";
                                }
                                else
                                {
                                    if (timespan.Hours > 0)
                                    {
                                        t = timespan.Hours + " giờ trước";
                                    }
                                    else
                                    {
                                        if (timespan.Minutes > 0)
                                        {
                                            t = timespan.Minutes + " phút trước";
                                        }
                                        else
                                        {
                                            t = timespan.Seconds + " giây trước";
                                        }
                                    }
                                }
                                string name = Item.TenDangNhapKH == null ? Item.HoTen : Item.TenDangNhapKH;
                                <li><a href=""><span class="icon-envelope"></span> Đơn đặt hàng từ <strong>@name</strong> <small class="muted"> - @t </small></a></li>
                            }
                            <li class="viewmore"><a href="@Url.Action("QL_ThongBao")">Xem tất cả thông báo</a></li>
                        </ul>
                    </li>
                    <li>
                        <a class="dropdown-toggle" href="@Url.Action("Index", "Home")">
                            <span class="count"></span>
                            <span class="head-icon head-home"></span>
                            <span class="headmenu-label">Trang nguời dùng</span>
                        </a>
                    </li>
                    @*<li class="odd">
                        <a class="dropdown-toggle" data-toggle="dropdown" data-target="#">
                            <span class="count">1</span>
                            <span class="head-icon head-bar"></span>
                            <span class="headmenu-label">Statistics</span>
                        </a>
                        <ul class="dropdown-menu">
                            <li class="nav-header">Statistics</li>
                            <li><a href=""><span class="icon-align-left"></span> New Reports from <strong>Products</strong> <small class="muted"> - 19 hours ago</small></a></li>
                            <li><a href=""><span class="icon-align-left"></span> New Statistics from <strong>Users</strong> <small class="muted"> - 2 days ago</small></a></li>
                            <li><a href=""><span class="icon-align-left"></span> New Statistics from <strong>Comments</strong> <small class="muted"> - 3 days ago</small></a></li>
                            <li><a href=""><span class="icon-align-left"></span> Most Popular in <strong>Products</strong> <small class="muted"> - 1 week ago</small></a></li>
                            <li><a href=""><span class="icon-align-left"></span> Most Viewed in <strong>Blog</strong> <small class="muted"> - 1 week ago</small></a></li>
                            <li class="viewmore"><a href="charts.html">View More Statistics</a></li>
                        </ul>
                    </li>*@
                    <li class="right">
                        <div class="userloggedinfo">
                            <img src="/Images/Admin/user.png" alt="" />
                            <div class="userinfo">
                                @{
                                    string TenDangNhap = Session["Admin"].ToString();
                                    var admin = db.QuanTris.First(m => m.TenDangNhap.Equals(TenDangNhap));
                                }
                                <h5>@admin.HoTen <small>- @admin.Email</small></h5>
                                <ul>
                                    <li><a href="editprofile.html">Thay đổi thông tin</a></li>
                                    <li><a href="index.html">Đăng xuất</a></li>
                                </ul>
                            </div>
                        </div>
                    </li>
                </ul><!--headmenu-->
            </div>
        </div>

        <div class="leftpanel">

            <div class="leftmenu">
                <ul class="nav nav-tabs nav-stacked">
                    <li class="nav-header">Navigation</li>
                    <li id="dashboard-menu"><a href="@Url.Action("Index")"><span class="iconfa-laptop"></span> Bảng điều khiển</a></li>
                    <li id=""><a href="@Url.Action("QL_NguoiDung")"><span class="iconfa-hand-up"></span> Quản lý người dùng</a></li>
                    <li><a href="@Url.Action("QL_DanhMuc")"><span class="iconfa-picture"></span> Quản lý danh mục</a></li>
                    <li id="product-menu"><a href="@Url.Action("QL_SanPham")"><span class="iconfa-font"></span> Quản lý sản phẩm</a></li>
                    <li id="banner-menu"><a href="@Url.Action("QL_Banner")"><span class="iconfa-signal"></span> Quản lý banner</a></li>
                    <li><a href="@Url.Action("QL_AnhSanPham")"><span class="iconfa-envelope"></span> Quản lý ảnh</a></li>
                    <li><a href="@Url.Action("QL_DonHang")"><span class="iconfa-calendar"></span> Quản lý đơn hàng</a></li>
                    <li><a href="@Url.Action("QL_QuanTri")"><span class="iconfa-signal"></span> Quản lý quản trị</a></li>
                    <li><a href="@Url.Action("QL_ThongBao")"><span class="iconfa-envelope"></span> Quản lý thông báo</a></li>
                    <li><a href="@Url.Action("QL_Khac")"><span class="iconfa-calendar"></span> Quản lý nội dung khác</a></li>
                    <li class="dropdown">
                        <a href=""><span class="iconfa-book"></span> Hệ thống</a>
                        <ul>
                            <li><a href="404.html">Sao lưu cơ sở dữ liệu</a></li>
                            <li><a href="editprofile.html">Hồi phục cơ sở dữ liệu</a></li>
                        </ul>
                    </li>
                </ul>
            </div><!--leftmenu-->

        </div><!-- leftpanel -->
        <div class="rightpanel">
            <ul class="breadcrumbs">
                @RenderSection("breadcrumbs", false)
            </ul>
            <div class="maincontent">
                <div class="maincontentinner">
                    @RenderBody()
                    <div class="footer">
                        <div class="footer-left">
                            <span>&copy; 2013. Shamcey Admin Template. All Rights Reserved.</span>
                        </div>
                        <div class="footer-right">
                            <span>Designed by: <a href="http://themepixels.com/">ThemePixels</a></span>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</body>
</html>
